Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2513: Update logging effect in automation #3437

Merged
merged 1 commit into from
May 24, 2017
Merged

Fix #2513: Update logging effect in automation #3437

merged 1 commit into from
May 24, 2017

Conversation

troydai
Copy link
Contributor

@troydai troydai commented May 24, 2017

  1. Print the executed commands and exit code when a test is failed.
  2. Print the failed commands' output.
  3. Hide msrest, vcr, or any other logger.

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

1. Print the executed commands and exit code when a test is failed.
2. Print the failed commands' output.
3. Hide msrest, vcr, or any other logger.
@codecov-io
Copy link

codecov-io commented May 24, 2017

Codecov Report

Merging #3437 into master will increase coverage by 0.01%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3437      +/-   ##
==========================================
+ Coverage   70.76%   70.78%   +0.01%     
==========================================
  Files         394      394              
  Lines       25586    25582       -4     
  Branches     3900     3898       -2     
==========================================
+ Hits        18106    18107       +1     
+ Misses       6333     6330       -3     
+ Partials     1147     1145       -2
Impacted Files Coverage Δ
...ure-cli-testsdk/azure/cli/testsdk/vcr_test_base.py 69.8% <100%> (+0.62%) ⬆️
src/azure-cli-testsdk/azure/cli/testsdk/base.py 71.72% <62.5%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3f7f51...0be4fd8. Read the comment docs.



class IntegrationTestBase(unittest.TestCase):
def __init__(self, method_name):
super(IntegrationTestBase, self).__init__(method_name)
self.diagnose = os.environ.get(ENV_TEST_DIAGNOSE, None) == 'True'

def cmd(self, command, checks=None, expect_failure=False):
if self.diagnose:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this being removed? I use this extensively during local troubleshooting. Or is this now accomplished another way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command will print in logging whenever the test fails. You don't need to set diagnostics anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, let's give it a shot :)

@tjprescott tjprescott merged commit 2e672ea into Azure:master May 24, 2017
@troydai troydai deleted the issue2513 branch May 24, 2017 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants